package com.smartsofa.photo;
import com.smartsofa.R;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
 
public class gridadapter extends BaseAdapter {
    private LayoutInflater inflater;
    String[] name;
 
    public gridadapter(Context context, String[] name) {
        this.inflater = LayoutInflater.from(context);
        this.name = name;
    }
 
    @Override
    public int getCount() {
        return name.length;
    }
 
    @Override
    public Object getItem(int position) {
        return position;
    }
 
    @Override
    public long getItemId(int position) {
        return position;
    }
 
    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        ViewHolder holder;
        if (convertView==null) {
            holder=new ViewHolder();
            convertView=this.inflater.inflate(R.layout.classify_pop_item1, null);
            holder.tv=(TextView) convertView.findViewById(R.id.circle_wk1);
            convertView.setTag(holder);
        }
        else {
           holder=(ViewHolder) convertView.getTag();
        }
        holder.tv.setText(name[position]);
        return convertView;
    }
    
    private class ViewHolder{
    	TextView tv;
    }
 
}